package com.hzncc.flowable_diboot.custom_field.entity;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
import java.lang.Double;
import java.math.BigDecimal;
import jakarta.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;


import com.diboot.core.util.D;
import com.diboot.core.entity.BaseModel;
import com.diboot.core.entity.BaseEntity;
import com.diboot.core.binding.query.BindQuery;
import com.diboot.core.binding.query.Comparison;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;

import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
* 字段配置 Entity 定义
* @author MyName
* @version 1.0
* @date 2024-10-09
* Copyright © MyCorp
*/

@TableName("mdl_custom_field")
@Getter @Setter @Accessors(chain = true)
public class CustomField extends BaseModel {
    private static final long serialVersionUID = 1720228959340980994L;

    /**
     * 租户
     */
    @NotNull(message = "租户不能为空")
    @TableField()
    private String tenantId;

    /**
     * 字段名
     */
    @NotNull(message = "字段名不能为空")
    @Length(max=100, message="字段名长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String fieldName;

    /**
     * 字段显示名
     */
    @NotNull(message = "字段显示名不能为空")
    @Length(max=100, message="字段显示名长度应小于100")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String fieldLabel;

    /**
     * 数据类型
     */
    @NotNull(message = "数据类型不能为空")
    @TableField()
    private String dataType;

    /**
     * 长度
     */
    @NotNull(message = "长度不能为空")
    @TableField()
    private Long length;

    /**
     * 是否必填
     */
    @TableField()
    private Boolean isRequire;

    /**
     * 是否唯一
     */
    @TableField()
    private Boolean isUnique;

    /**
     * 业务类型
     */
    @NotNull(message = "业务类型不能为空")
    @TableField()
    private String type;

    /**
     * 样式id
     */
    @Length(max=32, message="样式id长度应小于32")
    @BindQuery(comparison = Comparison.LIKE)
    @TableField()
    private String styleId;


}